﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using xKnight.Models;
using xKnight.WebCrawling.Core;

namespace xKnight.WebCrawling.Event
{
    public class CrawlAnnounceItem
    {
        public string Description { get; private set; }
        public Webpage Page { get; private set; }
        public WebCrawlingStatus CrawlStatus { get; private set; }
        public DateTime DateTime { get; private set; }
        public int TotalLinksFound { get; private set; }
        public int TotalUniqueLinksFound { get; private set; }
        public int TotalFormsFound { get; private set; }
        public int TotalUniqueFormsFound { get; private set; }
        public int TotalPagesDownloaded { get; private set; }

        public CrawlAnnounceItem(Webpage page, WebCrawlingStatus crawlStatus, string description, DateTime dateTime, CrawlingSharedResource crawlingSharedResource)
        {
            this.Description = description;
            this.Page = page;
            this.CrawlStatus = crawlStatus;
            this.DateTime = dateTime;
            this.TotalLinksFound = crawlingSharedResource.TotalLinksFound;
            this.TotalUniqueLinksFound = crawlingSharedResource.TotalUniqueLinksFound;
            this.TotalFormsFound = crawlingSharedResource.TotalFormsFound;
            this.TotalUniqueFormsFound = crawlingSharedResource.TotalUniqueFormsFound;
            this.TotalPagesDownloaded = crawlingSharedResource.TotalPagesDownloaded;
        }
    }
}
